﻿#include "ssRay2.h"


namespace StarSeeker
{

ssRay2::ssRay2()
{
	m_len = 1.0f;
}

ssRay2::ssRay2(ssVector2 p, ssVector2 d)
{
	m_dir = d;
	m_p0 = p;
}

ssRay2::~ssRay2()
{
}

void ssRay2::Set(ssVector2 p, ssVector2 d)
{
	m_p0 = p;
	m_dir = d;
}

void ssRay2::SetLength(ssfloat len)
{
	m_len = len;
}

ssVector2 ssRay2::Begin()
{
	return m_p0;
}

ssVector2 ssRay2::End()
{
	return m_p0+(m_dir*m_len);
}

ssfloat ssRay2::SquareOfLength()
{
	return m_len*m_len;
}

ssfloat ssRay2::Length()
{
	return m_len;
}

}
